home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
monitory
/
sysmon
/
docs
/
sysmon_lib.doc
Wrap
Text File
|
1995-11-05
|
12KB
|
387 lines
TABLE OF CONTENTS
sysmon.library/smFindTaskInfo
sysmon.library/smFreeze
sysmon.library/smGetTaskInfo
sysmon.library/smHalt
sysmon.library/smNextTaskInfo
sysmon.library/smSleep
sysmon.library/smUnFreeze
sysmon.library/smVKPrintf
sysmon.library/smVSPrintf
sysmon.library/smVSysLog
sysmon.library/smFindTaskInfo sysmon.library/smFindTaskInfo
NAME
smFindTaskInfo -- Find TaskInfo structure by Task Name. (V0)
SYNOPSIS
tinfo = smFindTaskInfo( name )
D0 A1
struct TaskInfo *smFindTaskInfo( STRPTR name );
FUNCTION
This function will search the TaskInfo Hash Table for a task with the
given name, and return a pointer to its TaskInfo structure. If a NULL
name pointer is given, a pointer to the TaskInfo of the current task
will be returned.
INPUTS
name - pointer to a NULL terminated string.
RESULT
tinfo - A pointer to the corresponding TaskInfo structure or NULL
for an error (TaskInfo structure not found).
NOTES
Unlike the exec.library/FindTask() function, this call does not
need to Disable() interrupts during search. It still needs to
Forbid() task switching though.
BUGS
SEE ALSO
exec.library/FindTask(), sysmon.library/smGetTaskInfo(),
sysmon.library/smNextTaskInfo()
sysmon.library/smFreeze sysmon.library/smFreeze
NAME
smFreeze -- Put a task out of schedule. (V0)
SYNOPSIS
success = smFreeze( task )
D0 A1
BOOL smFreeze( struct Task *task );
FUNCTION
Put a task into the TaskFrozen list. The task will no longer be
dispatched and will not respond to signals (including exception
signals). However, these signals are not lost ; they will be
processed when the task comes out of the frozen state.
INPUTS
task - A pointer to a Task structure. If NULL, the current task
will be frozen.
RESULT
success - A boolean value indicating the success of the operation.
This call will fail if for example, the Task was already
frozen
NOTES
This function may be called from interrupts with a non-NULL task
pointer.
This call is potentially dangerous. Freezing another task may lead
to deadlocks if the task was performing critical operations under
semaphore protection when it was frozen. So do not freeze another
task without good reasons.
When freezing yourself, make sure someone will bring you back to
life by calling smUnFreeze() on you.
BUGS
SEE ALSO
sysmon.library/smUnFreeze() , exec.library/Wait()
sysmon.library/smGetTaskInfo sysmon.library/smGetTaskInfo
NAME
smGetTaskInfo -- Get pointer to TaskInfo structure. (V0)
SYNOPSIS
tinfo = smGetTaskInfo( task )
D0 A0
struct TaskInfo *smGetTaskInfo( struct Task *task );
FUNCTION
Get a pointer to the TaskInfo structure associated to a given
Task.
INPUTS
task - A pointer to a Task structure. If NULL, the TaskInfo
structure of the current task will be returned.
RESULT
tinfo - A pointer to the corresponding TaskInfo structure or NULL
for an error (TaskInfo structure not found).
NOTES
BUGS
SEE ALSO
sysmon.library/smFindTaskInfo(), sysmon.library/smNextTaskInfo().
sysmon.library/smHalt sysmon.library/smHalt
NAME
smHalt -- Halts the system for safe power down. (V0)
SYNOPSIS
smHalt( flags )
D0
void smHalt( ULONG flags );
FUNCTION
This function will disable multitasking, blink the power LED, kill all
tasks except the caller, then display a guru like deadend alert saying
'System Shutdown Complete' (without time out).
It is then safe to turn the power off.
If the user presses a mouse button to cancel the alert, the system
will reset via exec.library/ColdReboot().
If the DEL key (ASCII $7f) is pressed on a serial port terminal while
the power LED is blinking, control will be transfered to the ROM
debugger (ROM-Wack for V37, SAD for V39+)
In any case, this function never returns.
INPUT
flags - A bit pattern specifying options. Currently defined are :
HALTB_REBOOT : The alert is not displayed, causing the system
to reboot immediately.
HALTB_REKICK : Forces MMU-SoftKicked machines to reload
KickStart by disabling the MMU before rebooting. This
requires a 68020 or greater CPU with a working MMU.
WARNING
This function does not care about filesystem consistency or whatever
other tasks are doing when it is called. It is the responsability of
the caller to take appropriate precautions before calling this
function.
BUGS
SEE ALSO
exec.library/ColdReboot(), exec.library/Alert()
sysmon.library/smNextTaskInfo sysmon.library/smNextTaskInfo
NAME
smNextTaskInfo -- Get the next TaskInfo entry. (V0)
SYNOPSIS
newtinfo = smNextTaskInfo( tinfo )
D0 A1
struct TaskInfo *smNextTaskInfo( struct TaskInfo *tinfo );
FUNCTION
This function returns the next TaskInfo structure in the Hash Table,
or NULL if there is no next entry.
INPUT
tinfo - Pointer to the current TaskInfo structure. If NULL, the
first TaskInfo structure will be returned.
RESULT
newtinfo - A pointer to the next TaskInfo in the table, or NULL if
the end has been reached.
WARNING
This function does not arbitrate for access to the TaskInfo HashTable.
You must be in Forbid() when calling it.
BUGS
SEE ALSO
exec.library/FindTask(), sysmon.library/smGetTaskInfo(),
sysmon.library/smFindTaskInfo()
sysmon.library/smSleep sysmon.library/smSleep
NAME
smSleep -- Put a task into hibernation for a specified time. (V0)
SYNOPSIS
success = smSleep( ticks )
D0 D0
BOOL smSleep( ULONG ticks );
FUNCTION
This function freezes the current task for the specified period of
time.
INPUTS
ticks - The number of ticks (50 per second) the task will sleep.
If ZERO, the function will return immediately.
RESULT
success - A boolean value indicating the success of the operation.
It may fail in very low memory conditions, in that case
the function returns immediately.
NOTES
This function uses the VBLANK unit of the timer.device with a
PA_SOFTINT reply port.
Because of the granularity of the VBLANK timer and the behaviour of
the frozen state, short delays may be inaccurate.
BUGS
SEE ALSO
dos.library/Delay(), sysmon.library/smFreeze(),
sysmon.library/smUnFreeze()
sysmon.library/smUnFreeze sysmon.library/smUnFreeze
NAME
smUnFreeze -- Put a frozen task back to life. (V0)
SYNOPSIS
success = smUnFreeze( task )
D0 A1
BOOL smUnFreeze( struct Task *task );
FUNCTION
Put a frozen task back into the ready or waiting list. If the task
has received signals when it was frozen, they will be precessed now.
INPUTS
task - A pointer to a Task structure.
RESULT
success - A boolean value indicating the success of the operation.
This call will fail if the Task was not frozen.
NOTES
This function may be called from interrupts.
The frozen state is not intended for short time waits or realtime
processing, so there is no guarantee that the unfrozen task will
restart processing immediately, even if its priority is greater
than the priority of the calling task.
BUGS
SEE ALSO
sysmon.library/smFreeze(), exec.library/Wait(), exec.library/Signal()
sysmon.library/smVKPrintf sysmon.library/smVKPrintf
NAME
smVKPrintf -- print formatted data to the debugging console. (V0)
(defaults to the serial port at 9600 baud)
SYNOPSIS
smVKPrintf( format, values )
A0 A1
VOID smVKPrintf(STRPTR format, APTR values);
FUNCTION
Print a formatted C-type string to the debugging console.
See the exec.library/RawDoFmt() call for the supported % formatting
commands.
INPUTS
format - A C style string with % commands to indicate where parameters
are to be inserted.
values - A pointer to an array of parameters, to be inserted into
specified places in the string.
RESULT
NONE
NOTES
RawDoFmt assumes 16 bit ints, so you will usually need 'l's in your
formats (ex: %ld versus %d).
This function may be called from interrupts.
BUGS
The exec.library/RawPutChar() called by this function will busy wait
when a ^S character is typed at the remote console. This will hang
the system if smVKPrintf() was called from a Forbid()/Disable()
section or from supervisor mode. Type ^Q at the remote terminal to
resume output.
SEE ALSO
dos.library/VPrintf(), exec.library/RawDoFmt(), debug.lib/KPrintF()
sysmon.library/smVSPrintf sysmon.library/smVSPrintf
NAME
smVSPrintf -- format data to a character buffer. (V0)
SYNOPSIS
endstr = smVSPrintf( buffer, format, values )
D0 A3 A0 A1
APTR smVSPrintf(STRPTR buffer, STRPTR format, APTR values);
FUNCTION
Print a formatted C-type string to a character buffer.
See the exec.library/RawDoFmt() call for the supported % formatting
commands.
INPUTS
buffer - A pointer to a buffer large enough to contain the resulting
string.
format - A C style string with % commands to indicate where parameters
are to be inserted.
values - A pointer to an array of parameters, to be inserted into
specified places in the string.
RESULT
endstr - A pointer to the end of the formatted data.
NOTES
RawDoFmt assumes 16 bit ints, so you will usually need 'l's in your
formats (ex: %ld versus %d).
This function may be called from interrupts.
BUGS
SEE ALSO
dos.library/VPrintf(), exec.library/RawDoFmt(), ANSI-C sprintf()
sysmon.library/smVSysLog sysmon.library/smVSysLog
NAME
smVSysLog -- Logs system messages to file or console. (V0)
SYNOPSIS
success = smVSysLog( priority, format, values )
D0 D0 A0 A1
BOOL smVSysLog(ULONG priority, STRPTR format, APTR values);
BOOL smSysLog(ULONG priority, STRPTR format, ...);
FUNCTION
Formats a system message via exec.library/RawDoFmt() and logs it
into a disk file and/or window and/or serial terminal based on
it's priority value and user defined thresholds.
INPUTS
priority - A priority value and optional flags as defined in sysmon.i .
Low values mean high severity.
LOG_NOHEAD can be used to write long messages in several
parts by skipping the header for subsequent calls.
LOG_NOWIN and LOG_NOFILE disable window and file logging
respectively in cases where it is not appropriate.
format - A C style string with % commands to indicate where parameters
are to be inserted.
values - A pointer to an array of parameters, to be inserted into
specified places in the string.
RESULT
success - A boolean value. TRUE for success, FALSE for an error.
NOTES
The Sysmon.server process must be running for this call to succeed.
The format buffer is limited to SM_MAXLOGCHARS chars, so make sure
your formatted string will not cause it to overflow.
The higher severity codes (LOG_EMERG and LOG_ALERT) are reserved for
system failures and should not be used by applications.
This function may return before logging is complete.
This function may be called from interrupts.
BUGS
If the format buffer overflows, havoc will break out.
SEE ALSO
exec.library/RawDoFmt(), sysmon.library/smVKPrintf(),
sysmon.library/smVSPrintf()